<template>
  <div class="v-link">
    <div v-for="item in videolist" :key="item.id" class="v-item">
        <a @click="path(item.id,item)"  class="v-link">
            <img :src="item.images[0].url" />
            <div class="p-icon"></div>
            <span class="title">{{ item.title }}</span>
        </a>

      <div class="v-info">
        <div class="user-info">
          <img :src="item.user.avatarurl" />
          <span class="u-name">{{ item.user.nickName }}</span>
        </div>
        <div class="v-tabbar">
          <div class="v-praise">
            <img src="../assets/img/v-info-img/video-praise.png" />
            <span class="count">{{ item.upCount }}</span>
          </div>
          <div class="v-comment">
            <img src="../assets/img/v-info-img/video-comment.png" />
            <span class="count">{{ item.commentCount }}</span>
          </div>
          <div class="v-share">
            <img src="../assets/img/v-info-img/video-share.png" />
            <span class="count">{{ item.shareCount }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    videolist: Array,
  },
  methods:{
      path(vid,Object){
          this.$router.push({path:"video/"+vid,query:{data:Object}})
      }
  }
};
</script>

<style lang="less" scoped>
.v-item {
  width: 100%;
  display: flex;
  flex-direction: column;

  .v-link {
    position: relative;
    height: 211px;
    overflow: hidden;

    img {
      width: 100%;
      position: absolute;
      top: 0px;
      left: 0px;
    }
    .p-icon {
      z-index: 2;
      position: absolute;
      left: 50%;
      top: 50%;
      width: 58px;
      height: 58px;
      margin-left: -29px;
      margin-top: -29px;
      background-image: url("../assets/img/v-info-img/video-btn-play.png");
      background-size: contain;
    }
    .title {
      position: absolute;
      top: 0px;
      left: 0px;
      // margin: 4.5px 7.5px 9.5px;
      margin: 9px 15px 19px;
      font-size: 17px;
      color: #fff;
    }
  }
  .v-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 15px;
    height: 46px;
    background: #fff;
    .user-info {
      display: flex;
      img {
        width: 22px;
        border-radius: 50%;
      }
      .u-name {
        font-size: 14px;
        margin-left: 8px;
      }
    }
    .v-tabbar {
      display: flex;
      align-items: center;
      .v-praise,
      .v-comment,
      .v-share {
        display: flex;
        align-items: center;
        margin-right: 12px;
        & > .count {
          font-size: 12px;
          padding: 0px 3px;
        }
      }
      img {
        width: 18px;
        height: 18px;
      }
    }
  }
}
</style>